package com.blockmeta.bbs.immodule.dao;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Index;

/**
 * 圈子成员关系表，用于和user表联合查询圈子成员,获取圈子里的备注名称
 * 唯一键设置为联合3个字段，用于replace into
 */
@Entity(indexes = {@Index(value = "whoId DESC, userId DESC, groupId DESC", unique = true)})
public class CircleMember {
    @Id(autoincrement = true)
    private Long id;

    //当前用户
    private long whoId;

    //用户Id
    private long userId;

    //圈子id
    private long groupId;

    /**
     * 圈子内的备注名称
     */
    private String remarkName;

    @Generated(hash = 1471948493)
    public CircleMember(Long id, long whoId, long userId, long groupId, String remarkName) {
        this.id = id;
        this.whoId = whoId;
        this.userId = userId;
        this.groupId = groupId;
        this.remarkName = remarkName;
    }

    @Generated(hash = 268294767)
    public CircleMember() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public long getWhoId() {
        return whoId;
    }

    public void setWhoId(long whoId) {
        this.whoId = whoId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getGroupId() {
        return groupId;
    }

    public void setGroupId(long groupId) {
        this.groupId = groupId;
    }

    public String getRemarkName() {
        return remarkName;
    }

    public void setRemarkName(String remarkName) {
        this.remarkName = remarkName;
    }

    @Override
    public String toString() {
        return "CircleMember{" +
                "id=" + id +
                ", whoId=" + whoId +
                ", userId=" + userId +
                ", groupId=" + groupId +
                ", remarkName='" + remarkName + '\'' +
                '}';
    }
}
